#!/bin/bash
dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
cd "$dir"
if hash tmux 2>/dev/null;
then
	mkdir -p ~/.tmux/plugins
	git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
	cp .tmux.conf ~
	tmux source ~/.tmux.conf
fi
if hash vim 2>/dev/null;
then
	curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
		https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
	cp .vimrc ~
fi
if hash nvim 2>/dev/null;
	curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
		https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
	cp init.vim ~/.config/nvim/
then
fi
if hash xterm 2>/dev/null;
then
	cp .Xresources ~
fi
if hash latexmk 2>/dev/null;
then
	cp .latexmk ~
fi
